The ISO/IEC 10918-1 standard, more commonly referred to as the JPEG standard after the Joint Photographic Experts Group that developed the standard, establishes a standard process for digital compression and coding of still images. The JPEG standard specifies a codec for compressing an image into a bitstream and for decompressing the bitstream back into an image.
A variety of container file formats including the JPEG File Interchange Format (JFIF) specified in ISO/IEC 10918-5 and the Exchangeable Image File Format (Exif) and can be used to store a JPEG bitstream. JFIF can be considered a minimal file format that enables JPEG bitstreams to be exchanged between a wide variety of platforms and applications. The color space used in JFIF files is YCbCr as defined by CCIR Recommendation 601, involving 256 levels. The Y, Cb, and Cr components of the image file are converted from R, G, and B, but are normalized so as to occupy the full 256 levels of an 8-bit binary encoding. YCbCr is one of the compression formats used by JPEG. Another popular option is to perform compression directly on the R, G and B color planes. Direct RGB color plane compression is also popular when lossless compression is being applied.
A JPEG bitstream stores 16-bit word values in big-endian format. JPEG data in general is stored as a stream of blocks, and each block is identified by a marker value. The first two bytes of every JPEG bitstream are the Start Of Image (SOI) marker values FFh D8h. In a JFIF-compliant file there is a JFIF APP0 (Application) marker, immediately following the SOI, which consists of the marker code values FFh E0h and the characters JFIF in the marker data, as described in the next section. In addition to the JFIF marker segment, there may be one or more optional JFIF extension marker segments, followed by the actual image data.
Overall the JFIF format supports sixteen “Application markers” to store metadata. Using application markers makes it is possible for a decoder to parse a JFIF file and decode only required segments of image data. Application markers are limited to 64K bytes each but it is possible to use the same maker ID multiple times and refer to different memory segments.
An APP0 marker after the SOI marker is used to identify a JFIF file. Additional APP0 marker segments can optionally be used to specify JFIF extensions. When a decoder does not support decoding a specific JFIF application marker, the decoder can skip the segment and continue decoding.
One of the most popular file formats used by digital cameras is Exif. When Exif is employed with JPEG bitstreams, an APP1 Application marker is used to store the Exif data. The Exif tag structure is borrowed from the Tagged Image File Format (TIFF) maintained by Adobe Systems Incorporated of San Jose, Calif.